#ifndef LOGICBOX_H
#define LOGICBOX_H

#include <stdint.h>

#ifdef __cplusplus
extern "C" 
{
#endif

int usbOpen(const char * device);
int usbClose(int fd);

void logicListDevices(int fd);
char * logicDeviceName(uint8_t device);

void logicReset(int fd);
uint32_t logicGetID(int fd);
void logicSetAddress(int fd, uint8_t type, uint8_t number, uint8_t addr);
void logicSetShortAddress(int fd, uint8_t number, uint8_t addr);

uint8_t logicReadByte(int fd);
int logicWriteByte(int fd, uint8_t data);
uint16_t logicReadWord(int fd);
void logicReadWordFIFO(int fd, uint16_t * data, uint16_t n);
int logicWriteWord(int fd, uint16_t data);
uint32_t logicReadLong(int fd);
int logicWriteLong(int fd, uint32_t data);

#ifdef __cplusplus
}
#endif

#endif
